home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / findutils.postinst < prev    next >
Encoding:
Text File  |  2010-10-26  |  1.2 KB  |  35 lines

  1. #! /bin/sh
  2. set -e
  3.  
  4. if [ "$1" = "configure" ]; then
  5.   # up to 4.1.7-2 locatedb was in non-FHS-dir /var/lib/locate
  6.   if dpkg --compare-versions "$2" le-nl "4.1.7-2" ; then
  7.     if [ -f /var/lib/locate/locatedb ]; then
  8.       mv /var/lib/locate/locatedb /var/cache/locate/
  9.       rmdir /var/lib/locate 2>/dev/null || true
  10.     fi
  11.   fi
  12.   # Remove locatedb if we are upgrading from findutils with included locate.
  13.  
  14.   # Sadly it does not really work to *not* do this if locate is going to be
  15.   # installed. "apt-get install locate" will first completely upgrade
  16.   # findutils (including running this script) before even _unpacking_ locate.
  17.   # Therefore # dpkg-query -W -f='${Status}'locate will be
  18.   # "something ok not-installed" when this script is run.
  19.  
  20.   if [ -d /var/cache/locate/ ] && \
  21.   dpkg --compare-versions "$2" le-nl "4.2.31-1" && \
  22.   locatestatus=`dpkg-query -W -f='${Status}' locate 2> /dev/null` ; then
  23.     locatestatus=`echo $locatestatus | cut -f3 -d\ `
  24.     case "$locatestatus" in
  25.       not-installed | config-files)
  26.         rm -f /var/cache/locate/locatedb
  27.         rmdir --ignore-fail-on-non-empty /var/cache/locate/
  28.       ;;
  29.     esac
  30.   fi
  31. fi
  32.  
  33.  
  34. # vim:tabstop=2:expandtab:shiftwidth=2
  35.